import uniqueId from '@form-create/utils/lib/unique';
import { makeRequiredRule } from '../../../utils/index'
const label = '标签';
const name = 'el-tag';
export default {
  //拖拽组件的图标
  icon: '',
  //拖拽组件的名称
  label,
  //拖拽组件的 key
  name,
  //拖拽组件的生成规则
  rule() {
    return {
      type: name,
      title: label,
      children: ['标签'],
      native: false, // 是否显示标题
      nativeEmit:['click'],
      props: {
        key: uniqueId(),
        type: 'success',
        size: 'small',
        effect: 'dark',
        closable: false,
        hit: false
      }
    };
  },
  //拖拽组件配置项(props)的生成规则
  props() {
    return [
      {
        type: 'input',
        field: 'formCreateTitle',
        title: '标签标题'
      },
      {
        type: 'input',
        field: 'formCreateChild',
        title: '标签内容'
      },
      {
        type:'select',
        field: 'type',
        title: '标签类型',
        options: [
          {label: 'success', value: 'success'},
          {label: 'info', value: 'info'},
          {label: 'warning', value: 'warning'},
          {label: 'danger', value: 'danger'}]
      },
      {
        type:'select',
        field: 'size',
        title: '标签尺寸',
        options: [
          {label: 'medium', value: 'medium'},
          {label: 'small', value: 'small'},
          {label: 'mini', value: 'mini'}]
      },
      {
        type:'select',
        field: 'effect',
        title: '标签主题',
        options: [
          {label: 'dark', value: 'dark'},
          {label: 'light', value: 'light'},
          {label: 'plain', value: 'plain'}]
      },
      {
        type: 'switch',
        field: 'closable',
        title: '是否可关闭'
      },
      {
        type: 'switch',
        field: 'hit',
        title: '是否有边框描边'
      }
    ];
  }
};

